import http from '../axios'

export default {
  /**
   * 获取试题信息
   * @param curPage 当前页
   * @param pageSize 每页的数量
   */
  getQuestions (curPage, pageSize, prop, isAsc) {
    return http.get('/questions', {
      curPage,
      pageSize,
      prop,
      isAsc
    })
  },
  /**
   * 删除题目
   * @param ids Array 题目的id
   */
  delQuestions (ids) {
    return http.del('/questions', {
      ids: ids
    })
  },
  editQuestion (question) {
    return http.put('/question', question)
  },
  addQues (ques) {
    return http.post('/question/person', ques)
  },
  batchQuestionUpdate (ids, category, level) {
    return http.put('/questions', {
      ids: ids,
      category: category,
      level: level
    })
  },
  categoryQuesCount (categories, type) {
    return http.get('/categoryQues/count', {
      categories,
      type
    })
  }
}
